<template>
  <div class='privilege'>
    <Table btns="4-1" :tableData="tableData" :tableTotable="false" :data0="data" :params="pageInfo" :pageSize="15" ></Table>
    <Edit v-if="$store.state.dia.privilege.show" @getList="getList" />
  </div>
</template>
<script>
import Table from "../common/table";
import Edit from './common/edit'
export default {
  components: {
    Table,Edit
  },
  name: "",
  data() {
    return {
      pageInfo:{
        page:1,
        total:0,
      },
      tableData:[
        {type:"index",name:"序号"},
        {prop:"division",name:"科室",width:""},
        {prop:"number",name:"职工号",width:""},
        {prop:"name",name:"姓名",width:""},
        {prop:"sex",name:"性别",width:""},
        {prop:"tel",name:"联系电话",width:""},
        {prop:"duty",name:"职务",width:""},
        {prop:"content",name:"权限",width:"250"},

        {prop:"",name:"操作",width:"",},
      ],
      // 列表数据
      data:[],
    };
  },
  methods: {
    getList(params){
      var goal=params||{...this.search,...this.pageInfo}
      _g.apiPost("auth/user",goal).then(res=>{
        this.$set(this,"data",res.data.list)
        this.pageInfo.total=res.data.total
      })
    },
  },
  created() {
    if(bus._events.reflash!==null){
      bus.$off("reflash")
    }
    this.getList()
    bus.$on("reflash",()=>{
      this.getList()
    })
  },
};
</script>
<style scoped>
.privilege {
}
</style>